home *** CD-ROM | disk | FTP | other *** search
- u
- CLIPS TECHNOTES
- by Dave Moorman
-
-
- CLIPS came to life after a great
- discovery. Several months ago, I was
- checking Scene World on my real C-64,
- and pressed <Y> at the FAST LOADER
- prompt. To my surprise, the music kept
- playing without slowing down while
- files were being loaded. This was a
- marvelous thing, and I wanted it for
- LOADSTAR.
-
- I contacted Joerg Droeg, publisher
- of Scene World, and he directed me to
- the Covert BitOps website. The FAST
- LOADER is the work of Lasse Oorni and
- others of the Euro Elite Demo Dudez.
- The source code was there, but I
- realized my limits. I got Robin
- Harbron to modify the code so we could
- use it in our
-
- SYS ADDR,FILE$,DV,LOCATION
-
- format. Robin got to it -- and did a
- great job. We called the result
- IRQLOADER.
-
- That's when I started CLIPS -- an
- improvement over MediaMeister as an
- all purpose, script-driven graphics/
- text/music presenter. But when I
- incorporated IRQLOADER, it didn't
- work.
-
- I don't know why. Perhaps the FAST
- LOADER doesn't like BASIC. Perhaps we
- are missing an important part of the
- concept. Robin sent me several fixes,
- but to no avail. The only option was
- to take out the IRQLOADER portion of
- CLIPS.
-
- But I still wanted to have the
- music. With VICE, there is no problem.
- The loads do not interrupt the
- interrupt. But trying to listen to
- music while loading a graphic file on
- a 1541 is pure torture. So I modified
- the code to pause the music during
- loads when the program detects a
- "real" disk drive (or True Drive in
- VICE).
-
- Our hope is to get IRQLOADER
- working correctly. When it does,
- version 2 of CLIPS will be released --
- along with IRQLOADER and all its
- documentation.
-
-
- BUT ALL IS NOT LOST
- -------------------
-
- CLIPS has some great features,
- including "konditional commands" which
- allow a script to become an
- interactive program. Granted, having
- BASIC read a script and respond is a
- tad pokey. But the power is there.
- Perhaps by V2 major portions will be
- handled by ML.
-
- The big thrill was getting
- variables to work. I tried doing it
- all in BASIC with arrays and such. The
- result consumed too much memory.
-
- So I whined about it to my PC
- guru, Kevin Barrow. He replied,
- "Doesn't BASIC do variables?"
-
- "Well, sure. But this is a BASIC
- program."
-
- "I know. Can't you copy your
- variable stuff to the end of BASIC
- memory and get the BASIC interpreter
- to do it for you?"
-
- "Uh -- maybe. But this is a BASIC
- program."
-
- "You're not listening to me,
- Dave!" he shot back.
-
- I [was] listening, but my mind was
- struggling with the possible ways to
- accomplish such a feat. It would
- require some ML -- copying code and
- redirecting the pointer in CHARGET and
- ....
-
- Then I had it! Pure simplicity,
- really. I wrote a test program to see
- if it would work.
-
- 10 GOTO30
- 20 rem :end:
- 30 a$="a=3+4*7"
- 40 forx=1tolen(a$)
- 50 poke2048+13+x,asc(mid$(a$,x))
- 60 next
- 70 goto20
-
- It didn't work. The problem turned out
- to be the difference between the ASCII
- values for characters such as "=" and
- "+" and the program token values for
- the same things. Using the monitor, I
- wrote out the conversions as IF-THEN
- statements.
-
- And [BAM!] It worked. I put the
- copy/conversion routine into ML, and
- added code to append ":RETURN:" to the
- copied string. Then I made line 2 of
- CLIPS the working line:
-
- 1 blah:blah:goto3
- 2 rem :
- 3 blah:blah
-
- The SYS ADDR,A$ puts the
- assignment into line 2:
-
- 2 VA=VAOR4:RETURN:
-
- and a GOSUB2 does all the work and
- returns the result.
-
- I decided that all valid variables
- would begin with a "v", and enforced
- the rule by making "v" the command
- letter. This way, none of the
- variables used in CLIPS will be
- changed. If you know what the
- variables are, you can "import" their
- values into a CLIPS script -- as I did
- in 2005 IN THE NEWS.
-
- <v0=lf>
-
- The variable lf is the Load Flag,
- which is 0 if VICE is being used (True
- Drive off). With that information in
- the script, I could ask non-VICE users
- if they wanted the music to play at
- all.
-
- Of course, this kind of trick
- requires a knowledge of CLIPS. Good
- luck!
-
- To get an idea how to use CLIPS,
- take a look at "c.2005", which is the
- "clipshow" file for 2005 IN THE NEWS.
- I use sub scripts, labels, and lots of
- konditional commands -- maybe too
- many.
-
- DMM
-
-
-